import { WeaTools } from 'ecCom';

const cowork = {
  // 协作列表
  getCoworkList: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkList', 'GET', params),
  // 协作内容
  viewCowork: params =>
    WeaTools.callApi('/api/cowork/view/viewCowork', 'GET', params),
  // 协作查看-高级搜索条件
  getDiscussRecordCondition: params =>
    WeaTools.callApi(
      '/api/cowork/view/getDiscussRecordCondition',
      'GET',
      params,
    ),
  // 查看日志高级搜索条件
  getLogViewCondition: params =>
    WeaTools.callApi(
      '/api/cowork/base/getCoworkLogViewCondition',
      'GET',
      params,
    ),
  // 标记协作类型
  markItemAsType: params =>
    WeaTools.callApi('/api/cowork/base/coworkMarkItemAsType', 'POST', params),
  /* 相关交流、与我相关 */
  discussRecord: params =>
    WeaTools.callApi('/api/cowork/view/discussRecord', 'GET', params),
  /* 参与情况 */
  getShareStat: params =>
    WeaTools.callApi(
      '/api/cowork/base/getShareConditionStrList',
      'GET',
      params,
    ),
  // 相关资源
  getResource: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkDiscussData', 'GET', params),
  // 协作应用启用状态
  getCoworkAppStatus: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkAppStatus', 'GET', params),
  // 协作应用默认数据
  getCoworkAppData: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkAppData', 'GET', params),
  // 提交协作评论/引用/交流记录
  submitCoworkDiscuss: params =>
    WeaTools.callApi('/api/cowork/base/submitCoworkDiscuss', 'POST', params),
  // 置顶/取消置顶/审批/收藏/删除评论/赞
  operateDicsuss: params =>
    WeaTools.callApi('/api/cowork/base/coworkDiscussOperation', 'POST', params),
  // 批量删除
  batchDelete: params => WeaTools.callApi('', 'POST', params),
  // 树
  getCoworkTreeDatas: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkTreeDatas', 'GET', params),
  // 协作标签列表
  getCoworkLabelList: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkLabelList', 'GET', params),
  // 协作-协作交流-获取当事人能查看的协作区类型集合
  getMyCoworkTypeList: params =>
    WeaTools.callApi('/api/cowork/base/getMyCoworkTypeList', 'GET', params),
  // 保存参与范围
  saveCoworkShare: params =>
    WeaTools.callApi(
      '/api/cowork/base/saveorupdateCoworkShare',
      'POST',
      params,
    ),
  // 获取协作类别下拉框
  getComboList: params =>
    WeaTools.callApi(
      '/api/cowork/base/getCoworkMainTypeComboList',
      'GET',
      params,
    ),
  // 查看日志
  getLog: params =>
    WeaTools.callApi('/api/cowork/base/coworkLogView', 'GET', params),
  // 协作交流-获取单个协作主题对象(编辑协作回显数据需要)
  getItemVo: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkItemVo', 'GET', params),
  // 获得版块列表
  getCoworkTypeList: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkTypeList', 'GET', params),
  // 批量删除版块
  batchDeleteCoworkType: params =>
    WeaTools.callApi('/api/cowork/base/batchDeleteCoworkType', 'POST', params),
  // 获得类别列表
  getCoworkMainTypeList: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkMainTypeList', 'GET', params),
  // 批量删除类别
  batchDeleteCoworkMainType: params =>
    WeaTools.callApi(
      '/api/cowork/base/batchDeleteCoworkMainType',
      'POST',
      params,
    ),
  // 保存协作类别
  saveCoworkMainTypeVo: params =>
    WeaTools.callApi(
      '/api/cowork/base/saveOrUpdateCoworkMainTypeVo',
      'POST',
      params,
    ),
  // 获得协作类别
  getCoworkMainTypeVo: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkMainTypeVo', 'GET', params),
  // 新建/编辑 协作版块对象
  saveOrUpdateTypeVo: params =>
    WeaTools.callApi(
      '/api/cowork/base/saveOrUpdateCoworkTypeVo',
      'POST',
      params,
    ),
  // 协作版块-负责人和创建者情况
  getCoworkTypeShareConditionStrList: params =>
    WeaTools.callApi(
      '/api/cowork/base/getCoworkTypeShareConditionStrList',
      'GET',
      params,
    ),
  // 更新标签设置列表
  uploadCoworkLabelList: params =>
    WeaTools.callApi('/api/cowork/base/uploadCoworkLabelList', 'POST', params),
  // 协作-获取协作版块对象
  getTypeVo: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkTypeVo', 'GET', params),
  // 协作-用户主界面操作权限
  getAuthorityByUser: params =>
    WeaTools.callApi('/api/cowork/base/coworkAuthorityByUser', 'GET', params),
  // 协作-删除协作绑定的标签
  deleteCoworkLabels: params =>
    WeaTools.callApi('/api/cowork/base/coworkdeleteItemLabels', 'POST', params),
  // 协作-协作版块负责人和创建者-新增/删除操作
  coworkTypeShareManagerOperation: params =>
    WeaTools.callApi(
      '/api/cowork/base/coworkTypeShareManagerOperation',
      'POST',
      params,
    ),
  // 协作-主题操作项
  coworkItemOperation: params =>
    WeaTools.callApi('/api/cowork/base/coworkItemOperation', 'POST', params),
  // 批量批准，批量拒绝
  batchDiscussApprove: params =>
    WeaTools.callApi(
      '/api/cowork/discussApproval/batchDiscussApprove',
      'POST',
      params,
    ),
  // 获取协作类别默认排序
  getCoworkMainTypeSequence: params =>
    WeaTools.callApi(
      '/api/cowork/base/getCoworkMainTypeSequence',
      'GET',
      params,
    ),
  // 获取协作附件目录
  getCoworkAccessory: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkAccessory', 'GET', params),
  // 获取协作视图模式
  getCoworkViewType: params =>
    WeaTools.callApi('/api/cowork/base/getCoworkViewType', 'GET', params),
  // 协作切换视图模式
  coworkChangeView: params =>
    WeaTools.callApi('/api/cowork/base/coworkChangeView', 'POST', params),
  // 协作切换参与类型
  coworkChangeJoinType: params =>
    WeaTools.callApi('/api/cowork/base/coworkChangeJoinType', 'POST', params),

  //                           -- 新建、编辑协作接口 --
  // 协作新建condition
  coworkAddCondition: params =>
    WeaTools.callApi('/api/cowork/base/coworkAddCondition', 'GET', params),
  // 协作参与范围-参与人列表
  coworkShareList: params =>
    WeaTools.callApi('/api/cowork/base/coworkShareList', 'GET', params),
  // 新建协作版块下拉框（取版块绑定的一些详细字段通过key关联）
  getNewMyCoworkTypeList: params =>
    WeaTools.callApi('/api/cowork/base/getNewMyCoworkTypeList', 'GET', params),
  // 协作-新建协作参与人者conditions（仅前台参与人使用）
  getWeaAuthConditions: params =>
    WeaTools.callApi('/api/cowork/base/getWeaAuthConditions', 'GET', params),
  // 协作交流-保存/编辑协作
  saveorupdateItemVo: params =>
    WeaTools.callApi(
      '/api/cowork/base/saveorupdateCoworkItemVo',
      'POST',
      params,
    ),
  // 协作交流-保存/编辑协作参与人信息
  saveorupdateCoworkShare: params =>
    WeaTools.callApi(
      '/api/cowork/base/saveorupdateCoworkShare',
      'POST',
      params,
    ),
  // 协作-协作主题-高级搜索条件
  getCoworkItemRecordCondition: params =>
    WeaTools.callApi(
      '/api/cowork/base/getCoworkItemRecordCondition',
      'GET',
      params,
    ),
  // 已退出人员
  getQuitList: params =>
    WeaTools.callApi('/api/cowork/base/coworkQuitList', 'GET', params),
  // 重新加入协作
  reJoinCoworkQuiter: params =>
    WeaTools.callApi('/api/cowork/base/reJoinCoworkQuiter', 'POST', params),
  // 退出协作
  quitCowork: params =>
    WeaTools.callApi('/api/cowork/base/quitCowork', 'POST', params),
  // 协作日志导出excel
  coworkLogExport: params =>
    WeaTools.callApi('/api/cowork/base/coworkLogExport', 'GET', params),
  // 负责人和创建者情况table（新）
  getCoworkTypeShareList: params =>
    WeaTools.callApi('/api/cowork/type/getCoworkTypeShareList', 'GET', params),
  // 协作交流-校验负责人
  judgeCoworkAuthorityChange: params =>
    WeaTools.callApi(
      '/api/cowork/base/judgeCoworkAuthorityChange',
      'POST',
      params,
    ),
};

export default cowork;
